<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE HTML>

<ui:composition template="/dinamic/template/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="conteudo">
  		<h:form>
  		<p:dataTable  var="assunto" value="#{baseDeConhecimentoManagedBean.listaAssuntos}" >
				    	<p:columnGroup  type="header">
							<p:row>
								<p:column headerText="Assuntos" colspan="2"/>
							</p:row>
						</p:columnGroup>    
				        <p:column>
				        	<p:commandLink styleClass="link" ajax="false" value="#{assunto.nomeAssunto}" action="#{baseDeConhecimentoManagedBean.listaPostagens()}" >
				           		<f:setPropertyActionListener target="#{baseDeConhecimentoManagedBean.assunto}" value="#{assunto}"/>
				            </p:commandLink>
				        </p:column>  
				        <p:column style="width:20%">
							<h:outputText styleClass="name" value="#{baseDeConhecimentoManagedBean.contagemAssunto(assunto.idAssunto)} postagem(s)" />
						</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>